<!-- 投诉类型 -->
<template>
	<view class="type">
		<view class=""> {{title}} </view>
		<view>
			<view class="" v-for="({dictLabel},i) in list" :key="i" @click="toContent(dictLabel)">
				<view class="">
					{{dictLabel}}
				</view>
				<uni-icons type="right" class="right" size="20"></uni-icons>
			</view>
		</view>
	</view>
</template>
<script>
	export default ({
		data() {
			return {
				list: [],
				title: '',
				orderid: '',
				taskId: '',
				taskStatus: ''
			}
		},
		mounted() {
			this.getList()
		},
		onLoad(value) {
			let {
				orderid,
				title,
				taskId,
				taskStatus
			} = value
			this.title = title
			this.orderid = orderid
			this.taskStatus = taskStatus
			this.taskId = taskId
			// 修改标题
			// wx.setNavigationBarTitle({
			// 	title: title
			// })
		},
		methods: {
			toContent(e) {
				uni.redirectTo({
					url: `/pages/tousu/boss/content?orderid=${this.orderid}&title=${e}&plate=${this.title}&taskId=${this.taskId}&taskStatus=${this.taskStatus}`
				})
			},
			async getList() {
				let res = await this.$fetch(this.$api.query_complaints_section_detail, {
					plate: this.title
				}, 'GET')
				if (res.code) return
				this.list = res.data
			},
		},
	})
</script>
<style lang="scss" scoped>
	.type {
		width: 100vw;
		height: 100vh;
		background: #fff;
		overflow: hidden;

		&>view:first-child {
			font-size: 36rpx;
			font-weight: 800;
			color: #515151;
			margin: 50rpx 0 40rpx 28rpx;
		}

		&>view:last-child {
			margin: 0 28rpx;

			&>view {
				height: 120rpx;
				background: #F1F1F5;
				border-radius: 12rpx;
				opacity: 1;
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-bottom: 20rpx;

				&>view {
					font-size: 32rpx;
					font-weight: bold;
					color: #1A1A1A;
					margin-left: 20rpx;
				}

				.right {
					margin-right: 20rpx;
				}
			}
		}
	}
</style>